{% extends "base.html" %}
{% load static %}

{% block title %}TestBrain - 知识库管理{% endblock %}

{% block content %}
<div class="card">
    <div class="card-header">
        添加知识条目
    </div>
    <div class="card-body">
        <form id="add-knowledge-form">
            <div class="form-group">
                <label for="knowledge-title">标题:</label>
                <input type="text" id="knowledge-title" name="title" class="form-control" required data-error-message="请输入知识条目标题">
            </div>
            
            <div class="form-group">
                <label for="knowledge-content">内容:</label>
                <textarea id="knowledge-content" name="content" class="form-control" rows="10" required data-error-message="请输入知识条目内容"></textarea>
            </div>
            
            <div class="text-right">
                <button type="submit" class="btn btn-primary">添加知识条目</button>
            </div>
        </form>
    </div>
</div>

<div class="card mt-3">
    <div class="card-header">
        知识库列表
    </div>
    <div class="card-body">
        <div class="form-group">
            <input type="text" id="knowledge-search" class="form-control" placeholder="搜索知识库...">
        </div>
        
        <div id="knowledge-list">
            <div class="text-center">
                <div class="spinner"></div>
                <p>加载知识库...</p>
            </div>
        </div>
    </div>
</div>
{% endblock %}

{% block extra_js %}
<script src="{% static 'js/knowledge.js' %}"></script>
{% endblock %} 